﻿using System.Web.Mvc;

namespace Wekit.Areas.Publish
{
    public class PublishAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "Publish";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                 "Publish_NoAction",
                 "Publish/{controller}.aspx",
                 new { controller = "Home", action = "Index", id = "" });//无Action的匹配
            context.MapRoute(
                "Publish_NoID",
                "Publish/{controller}/{action}.aspx",
                new { controller = "Home", action = "Index", id = "" });//无ID的匹配
            context.MapRoute(
                "Publish_Default",
                "Publish/{controller}/{action}/{id}.aspx",
                 new { controller = "Home", action = "Index", id = "" });//默认匹配
            context.MapRoute(
                "Publish_Root",
                 "Publish",
                 new { controller = "Home", action = "Index", id = "" });//根目录匹配
        }
    }
}
